package com.minimalist.common.entity.basic.po;

import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;

/**
 * 租户套餐与权限关联表 实体类。
 *
 * @author 小太阳
 * @since 2024-10-18
 */
@Table(value = "m_tenant_package_perm")
public class MTenantPackagePerm implements Serializable{

    public MTenantPackagePerm() {
    }

    public MTenantPackagePerm(Long packageId, Long permId) {
        this.packageId = packageId;
        this.permId = permId;
    }

    public Long getPackageId() {
        return packageId;
    }

    public void setPackageId(Long packageId) {
        this.packageId = packageId;
    }

    public Long getPermId() {
        return permId;
    }

    public void setPermId(Long permId) {
        this.permId = permId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MTenantPackagePerm that = (MTenantPackagePerm) o;
        if (packageId != null ? !packageId.equals(that.packageId) : that.packageId != null) return false;
        return permId != null ? permId.equals(that.permId) : that.permId == null;
    }

    @Override
    public int hashCode() {
        int result = packageId != null ? packageId.hashCode() : 0;
        result = 31 * result + (permId != null ? permId.hashCode() : 0);
        return result;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long packageId;
        private Long permId;

        Builder() {
        }

        public Builder packageId(Long packageId) {
            this.packageId = packageId;
            return this;
        }

        public Builder permId(Long permId) {
            this.permId = permId;
            return this;
        }

        public MTenantPackagePerm build() {
            return new MTenantPackagePerm(packageId, permId);
        }
    }

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 租户套餐ID
     */
    private Long packageId;

    /**
     * 权限ID
     */
    private Long permId;

}
